package dq.study.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @author dongqun
 * @date 2020/2/20 13:22
 */
@Aspect
public class MyAspect {
    @Pointcut("execution(* dq.study.aop.Business.*(..))")
    public void pointcut() {
    }

    @Before("pointcut()")
    public void before(JoinPoint joinPoint) {
        System.out.println("before:" + joinPoint.getSignature().getName());
    }

    @AfterReturning(value = "pointcut()",returning = "obj")
    public void after(JoinPoint joinPoint,Object obj) {
        System.out.println("before:" + joinPoint.getSignature().getName()+"returen:"+obj);
    }
}
